From d1a85fc9e49a0afa3cafc3aec98264d65a630f18 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 22 Oct 2015 20:58:52 -0400 Subject: [PATCH] css node declaration: Allow both name and type to be set The widget path machinery assumes that we always have types, and without this change, it will start spewing warnings when we start to introduce node names. --- gtk/gtkcssnodedeclaration.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/gtk/gtkcssnodedeclaration.c b/gtk/gtkcssnodedeclaration.c index 6d861fb448..1c5187b4b6 100644 --- a/gtk/gtkcssnodedeclaration.c +++ b/gtk/gtkcssnodedeclaration.c @@ -170,12 +170,10 @@ gboolean gtk_css_node_declaration_set_type (GtkCssNodeDeclaration **decl, GType type) { - if ((*decl)->type == type && - (*decl)->name == NULL) + if ((*decl)->type == type) return FALSE; gtk_css_node_declaration_make_writable (decl); - (*decl)->name = NULL; (*decl)->type = type; return TRUE; @@ -191,12 +189,10 @@ gboolean gtk_css_node_declaration_set_name (GtkCssNodeDeclaration **decl, /*interned*/ const char *name) { - if ((*decl)->type == 0 && - (*decl)->name == name) + if ((*decl)->name == name) return FALSE; gtk_css_node_declaration_make_writable (decl); - (*decl)->type = 0; (*decl)->name = name; return TRUE; -- 2.30.2